<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\common\logic;

use app\common\model\UserAccount;
use think\Db;

/**
 * Bank逻辑
 */
class ApplicationClass extends LogicBase
{

    /**
     * 获取Applicationclass列表
     */
    public function getApplicationClassList($where = [], $field = 'a.*', $order = 'sort desc')
    {

        $this->modelApplicationClass->alias('a');



        $where['a.' . DATA_STATUS_NAME] = ['neq', DATA_DELETE];

        $count=$this->modelApplicationClass->where($where)->count();
        $this->modelApplicationClass->alias('a');
        return ['list'=>$this->modelApplicationClass->getList($where, $field, $order),'count'=>$count] ;
    }


    /**
     * 获取Application列表搜索条件
     */
    public function getWhere($data = [])
    {

        $where = [];

        !empty($data['search_data']) && $where['a.name'] = ['like', '%'.$data['search_data'].'%'];

        return $where;
    }

    /**
     * 获取Application信息
     */
    public function getApplicationClassInfo($where = [], $field = 'a.*')
    {

        $this->modelApplicationClass->alias('a');


        $where['a.' . DATA_STATUS_NAME] = ['neq', DATA_DELETE];

        return $this->modelApplicationClass->getInfo($where, $field);
    }



}
